{"ast":null,"code":"import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nimport { isPresetColor } from './utils';\nconst Ribbon = function Ribbon(_ref) {\n  let {\n    className,\n    prefixCls: customizePrefixCls,\n    style,\n    color,\n    children,\n    text,\n    placement = 'end'\n  } = _ref;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n  const colorInPreset = isPresetColor(color);\n  const ribbonCls = classNames(prefixCls, `${prefixCls}-placement-${placement}`, {\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-color-${color}`]: colorInPreset\n  }, className);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const colorStyle = {};\n  const cornerColorStyle = {};\n  if (color && !colorInPreset) {\n    colorStyle.background = color;\n    cornerColorStyle.color = color;\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(`${prefixCls}-wrapper`, hashId)\n  }, children, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(ribbonCls, hashId),\n    style: Object.assign(Object.assign({}, colorStyle), style)\n  }, /*#__PURE__*/React.createElement(\"span\", {\n    className: `${prefixCls}-text`\n  }, text), /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-corner`,\n    style: cornerColorStyle\n  }))));\n};\nexport default Ribbon;","map":{"version":3,"names":["classNames","React","ConfigContext","useStyle","isPresetColor","Ribbon","_ref","className","prefixCls","customizePrefixCls","style","color","children","text","placement","getPrefixCls","direction","useContext","colorInPreset","ribbonCls","wrapSSR","hashId","colorStyle","cornerColorStyle","background","createElement","Object","assign"],"sources":["/data/messenger.client/node_modules/antd/es/badge/Ribbon.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nimport { isPresetColor } from './utils';\nconst Ribbon = function Ribbon(_ref) {\n  let {\n    className,\n    prefixCls: customizePrefixCls,\n    style,\n    color,\n    children,\n    text,\n    placement = 'end'\n  } = _ref;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n  const colorInPreset = isPresetColor(color);\n  const ribbonCls = classNames(prefixCls, `${prefixCls}-placement-${placement}`, {\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-color-${color}`]: colorInPreset\n  }, className);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const colorStyle = {};\n  const cornerColorStyle = {};\n  if (color && !colorInPreset) {\n    colorStyle.background = color;\n    cornerColorStyle.color = color;\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(`${prefixCls}-wrapper`, hashId)\n  }, children, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(ribbonCls, hashId),\n    style: Object.assign(Object.assign({}, colorStyle), style)\n  }, /*#__PURE__*/React.createElement(\"span\", {\n    className: `${prefixCls}-text`\n  }, text), /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-corner`,\n    style: cornerColorStyle\n  }))));\n};\nexport default Ribbon;"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,QAAQ,MAAM,SAAS;AAC9B,SAASC,aAAa,QAAQ,SAAS;AACvC,MAAMC,MAAM,GAAG,SAASA,MAAM,CAACC,IAAI,EAAE;EACnC,IAAI;IACFC,SAAS;IACTC,SAAS,EAAEC,kBAAkB;IAC7BC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,IAAI;IACJC,SAAS,GAAG;EACd,CAAC,GAAGR,IAAI;EACR,MAAM;IACJS,YAAY;IACZC;EACF,CAAC,GAAGf,KAAK,CAACgB,UAAU,CAACf,aAAa,CAAC;EACnC,MAAMM,SAAS,GAAGO,YAAY,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